<?php
$this->breadcrumbs=array(
	Yii::t('yii','Search'),
);

?>

<h1><?php echo Yii::t('yii','Search'); ?></h1>

<?php $this->widget('textedit.components.TextEditor', array('id'=>'searchindex')); ?>

<div class="searchForm">
<?php echo Html::beginForm(); ?>
<?php echo Html::errorSummary($model); ?>

	<div class="simple">
		<?php echo Html::activeTextField($model,'word'); ?> <?php echo Yii::t('yii','in'); ?> <?php echo Html::activedropDownList($model, 'type',array('post'=>Yii::t('yii','Articles'),'user'=>Yii::t('yii','Users')), array('empty' =>Yii::t('yii','Choose'))); ?>
	</div>	

	<div class="action">
		<?php echo Html::submitButton(Yii::t('yii','Search'),array('class'=>'submit')); ?>
	</div>
<?php echo Html::endForm(); ?>
</div>


<?php 

if(isset($dataProvider)){
	$this->widget('zii.widgets.CListView', array(
		'dataProvider'=>$dataProvider,
		'itemView'=>'_'.$folder,
	)); 
}

?>

<script type="text/javascript">
$('form').bind("submit", function() { return false; });

$('.submit').bind("click", function () {
  jQuery.ajax({
'type':'POST',
'dataType' : 'html',
'url': jQuery(this).parents("form").attr("action"),
'cache':false,
'data':jQuery(this).parents("form").serialize(),
'success':function(html){
jQuery("#content").html(html);
   $("#content a:not(.static)").each(function(){
            $(this).attr('href', "#"+$(this).attr("href"));
        });
}
});
  return false;
});
</script>
